﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NginxServiceHelper.Common
{
    public class NginxConfig
    {
        const string cfgFileName = "conf/nginx.conf";

        public string Include { get; set; } = "mime.types";
        public string DefaultType { get; set; } = "application/octet-stream";
        /// <summary>
        /// 是否启用gzip
        /// </summary>
        public bool Gzip { get; set; }

        public List<NginxHttpItem> Servers;
    }
    public class NginxHttpItem
    {
        public string Name { get; set; }
        /// <summary>
        /// 监听端口
        /// </summary>
        public string Listen { get; set; }
        /// <summary>
        /// 是否ssl
        /// </summary>
        public bool IsSSL { get; set; }
        /// <summary>
        /// ssl证书
        /// </summary>
        public string SSLCert { get; set; }
        public string SSLCertKey { get; set; }
        /// <summary>
        /// 加密模式
        /// </summary>
        public string SSLCiphers { get; set; }

        public NginxLocation Location { get; set; }
    }
    public class NginxLocation
    {
        public string Root { get; set; }
        public string Index { get; set; } = "index.html index.htm";

        public List<string[]> AddHeaders { get; set; }
    }
}
